<template>
  <div class="report-management">
               <div class="welcome-section">
        <h2>报表页面</h2>
        <p>请选择您要查看的报表类型</p>
      </div>
    
    <div class="report-cards">
             <el-card 
         class="report-card primary-card" 
         @click="navigateToDefectiveItemDistribution"
         shadow="hover"
       >
         <div class="card-content">
           <el-icon class="card-icon" size="50">
             <DocumentCopy />
           </el-icon>
           <h3>不良品项分布</h3>
           <p>查看和分析不良品项的分布情况，包括不良品项的数量、比例和分布趋势</p>
           <div class="card-action">
             <el-button type="primary" size="small">进入报表</el-button>
           </div>
         </div>
       </el-card>
      
             <el-card 
         class="report-card primary-card" 
         @click="navigateToDefectItemSummary"
         shadow="hover"
       >
         <div class="card-content">
           <el-icon class="card-icon" size="50" style="color: #67c23a;">
             <DocumentCopy />
           </el-icon>
           <h3>不良品项汇总</h3>
           <p>查看不良品项的汇总信息和生产统计，包括工单、产品、工序等详细信息</p>
           <div class="card-action">
             <el-button type="success" size="small">进入报表</el-button>
           </div>
         </div>
       </el-card>
      
      <!-- 可以添加更多报表卡片 -->
             <el-card 
         class="report-card primary-card" 
         @click="navigateToProductionReport"
         shadow="hover"
       >
         <div class="card-content">
           <el-icon class="card-icon" size="50" style="color: #e6a23c;">
             <DataAnalysis />
           </el-icon>
           <h3>生产报表</h3>
           <p>查看生产工单的详细信息和统计数据，包括计划数量、实际数量、完成率等</p>
           <div class="card-action">
             <el-button type="warning" size="small">进入报表</el-button>
           </div>
         </div>
       </el-card>
      
      <el-card 
        class="report-card primary-card" 
        @click="navigateToOutputStatistics"
        shadow="hover"
      >
        <div class="card-content">
          <el-icon class="card-icon" size="50" style="color: #909399;">
            <DataAnalysis />
          </el-icon>
          <h3>产量统计</h3>
          <p>查看产量统计数据，包括计划数量、实际产量、完成率等详细信息</p>
          <div class="card-action">
            <el-button type="info" size="small">进入报表</el-button>
          </div>
        </div>
      </el-card>
      

      

    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { DocumentCopy, DataAnalysis } from '@element-plus/icons-vue'

const router = useRouter()

const navigateToDefectiveItemDistribution = () => {
  router.push('/defective-item-distribution')
}

const navigateToDefectItemSummary = () => {
  router.push('/defect-item-summary')
}

const navigateToProductionReport = () => {
  router.push('/production-report')
}

const navigateToOutputStatistics = () => {
  router.push('/output-statistics')
}




</script>

<style scoped>
.report-management {
  padding: 20px;
  background: #f5f7fa;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.welcome-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.welcome-section h2 {
  color: #303133;
  margin-bottom: 10px;
  font-size: 28px;
}

.welcome-section p {
  color: #606266;
  font-size: 16px;
  margin: 0;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.report-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  border-radius: 12px;
}

.report-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-content {
  text-align: center;
  padding: 20px;
}

.card-icon {
  color: #409eff;
  margin-bottom: 15px;
}

.card-content h3 {
  color: #303133;
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
}

 .card-content p {
   color: #606266;
   margin: 0 0 15px 0;
   font-size: 14px;
   line-height: 1.5;
 }

 .card-action {
   margin-top: 10px;
 }

 .primary-card {
   border: 2px solid #409eff;
   background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
   position: relative;
   overflow: hidden;
 }

 .primary-card::before {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
   transition: left 0.5s;
 }

 .primary-card:hover::before {
   left: 100%;
 }

 .primary-card:hover {
   border-color: #67c23a;
   transform: translateY(-8px);
   box-shadow: 0 12px 30px rgba(64, 158, 255, 0.2);
 }

 .primary-card:nth-child(2) {
   border-color: #67c23a;
   background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
 }

 .primary-card:nth-child(2):hover {
   border-color: #409eff;
   box-shadow: 0 12px 30px rgba(103, 194, 58, 0.2);
 }

 .primary-card:nth-child(3) {
   border-color: #e6a23c;
   background: linear-gradient(135deg, #fffbf0 0%, #ffffff 100%);
 }

 .primary-card:nth-child(3):hover {
   border-color: #409eff;
   box-shadow: 0 12px 30px rgba(230, 162, 60, 0.2);
 }

 .primary-card:nth-child(4) {
   border-color: #909399;
   background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
 }

 .primary-card:nth-child(4):hover {
   border-color: #409eff;
   box-shadow: 0 12px 30px rgba(144, 147, 153, 0.2);
 }





/* 自定义滚动条样式 */
.report-management::-webkit-scrollbar {
  width: 8px;
}

.report-management::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.report-management::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.report-management::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .report-management {
    height: calc(100vh - 80px);
    padding: 15px;
  }
  
  .report-cards {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }
  
  .welcome-section {
    padding: 20px;
  }
  
  .welcome-section h2 {
    font-size: 24px;
  }
}
</style>
